home *** CD-ROM | disk | FTP | other *** search
- /*
- * attributes.c
- *
- * Copyright 2000, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- *
- * UNPUBLISHED -- Rights reserved under the copyright laws of the United
- * States. Use of a copyright notice is precautionary only and does not
- * imply publication or disclosure.
- *
- * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
- * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
- * in similar or successor clauses in the FAR, or the DOD or NASA FAR
- * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
- * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
- *
- * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
- * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
- * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
- * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
- * GRAPHICS, INC.
- */
- /* $XConsortium: attributes.c /main/cde1_maint/1 1995/07/17 16:41:12 drk $ */
- /*
- * (c) Copyright 1993, 1994 Hewlett-Packard Company
- * (c) Copyright 1993, 1994 International Business Machines Corp.
- * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
- * (c) Copyright 1993, 1994 Novell, Inc.
- */
-
- /*
- * attributes.c - retrieve calendar attributes
- */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <string.h>
- #include <sys/param.h>
- #include <sys/types.h>
-
- #include <csa/csa.h>
-
- void main(int argc, char **argv)
- {
- CSA_session_handle cal;
- CSA_calendar_user user;
- CSA_uint32 num_names;
- CSA_attribute_reference *names;
- CSA_return_code stat;
- int i;
-
- if (argc < 2) {
- printf("usage: %s user@host\n", argv[0]);
- return;
- }
-
- #if defined ( linux )
- memset((void *)&user, 0, sizeof(CSA_calendar_user));
- #else /* linux */
- memset((void *)&user, NULL, sizeof(CSA_calendar_user));
- #endif /* linux */
- user.calendar_address = argv[1];
-
- if ((stat = csa_logon(NULL, &user, NULL, NULL, NULL, &cal, NULL))
- != CSA_SUCCESS)
- {
- printf("Logon to %s failed, stat = %d\n", argv[1],
- stat);
- return;
- }
-
- if ((stat = csa_list_calendar_attributes(cal, &num_names, &names,
- NULL)) == CSA_SUCCESS) {
-
- printf("List calendar attributes:\n");
- for (i = 0; i < num_names; i++)
- printf("%s\n", names[i]);
-
- csa_free(names);
- } else
- printf("csa_list_calendar_attributes failed, stat = %d\n",
- stat);
-
- (void)csa_logoff(cal, NULL);
- }
-
-